package cn.gyn.gyn_rpc_demo;

import cn.gyn.gynrpc.core.annotation.EnableGynrpc;
import cn.gyn.gynrpc.core.annotation.GynConsumer;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@EnableGynrpc
public class RpcdemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(RpcdemoApplication.class, args);
    }

    @GynConsumer
    OrderService orderService;

    @Bean
    ApplicationRunner demo_runner() {
        return x -> {
            TripOrder order = orderService.query(100);
            System.out.println(" ===> orderService.query : " + order);
        };
    }

}
